const Controller = require('egg').Controller;

class UserController extends Controller{
    async userinfo(){
        const userservice = this.ctx.service.userservice;
        const uid = this.ctx.request.headers['user'];
        const rid = this.ctx.request.query.rid;
        const userinfo = await userservice.getUser(uid,rid);

        if(userservice.getUser(uid)){
            this.ctx.code = 200;
            this.ctx.body = userinfo;
        }else{
            this.ctx.code =301;
            this.ctx.body = 'not found user';
        }
    }
}
module.exports = UserController;
